package com.webbei.Backstage.action;

import java.io.IOException;

import org.apache.struts2.ServletActionContext;

import com.webbei.Backstage.service.BackstateSer;

public class UpdateAdvertismentImageAction {
	  private BackstateSer bao;
	  private String checkId;
	  public String execute(){
		  System.out.println(checkId);
		  String[] s=checkId.split(",");
		  bao.clearAllTheAdvertismentShow();
		  for(String str:s){
			  String[] ss = str.split("---");	  
			  int id=Integer.parseInt(ss[0]);
			  String address = (ss.length<2)? "":ss[1];
			  bao.setTheAdvIsShowById(id,address);
		  }
		  try {
			ServletActionContext.getResponse().getWriter().write("success");
			ServletActionContext.getResponse().setContentType("text/html");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		  return null;
	  }
	public BackstateSer getBao() {
		return bao;
	}
	public void setBao(BackstateSer bao) {
		this.bao = bao;
	}
	public String getCheckId() {
		return checkId;
	}
	public void setCheckId(String checkId) {
		this.checkId = checkId;
	}
	  
}
